package com.baizhi.service.Impl;

import com.baizhi.dao.NewsDao;
import com.baizhi.News;
import com.baizhi.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NewsServiceImpl implements NewsService {
    @Autowired
    private NewsDao nd;
    @Override
    public List<News> selectAll() {
        return nd.selectList(null);
    }

    @Override
    public boolean delete(int id) {
        int i = nd.deleteById(id);
        if (i!=0){
            return true;
        }
        return false;
    }
}
